import React from 'react'
import { render } from 'react-dom'
import {Router, Route, IndexRoute} from 'react-router'

import MainView from './MainView.jsx'
import RootView from './RootView.jsx'
import DrillView from './DrillView.jsx'
import TraceView from './TraceView.jsx'

import JSRootView from './JSRootView.jsx'
import JSDrillView from './JSDrillView.jsx'
import JSTraceView from './JSTraceView.jsx'
import history from '../common/history.es6';

render((
  <Router history={ history }>
    <Route path="/" component={MainView}>
      <IndexRoute component={RootView} />
      <Route path="measurementname/:interactionId" component={DrillView} />
      <Route path="measurementname/:interactionId/hostname/:hostname" component={DrillView} />
      <Route path="traces/:traceId" component={TraceView} />

      <Route path="jserror/" component={JSRootView}/>
      <Route path="jserror/measurementname/:interactionId" component={JSDrillView} />
      <Route path="jserror/measurementname/:interactionId/jsurl/:jsurlId" component={JSDrillView} />
      <Route path="jserror/traces/:traceId" component={JSTraceView}/>
    </Route>
  </Router>
), document.getElementById('root'));
